import Vue from 'vue'
import Router from 'vue-router'
import HomePage from '@/view/home/home.vue'

import DemoPage from '@/view/demo/demo1'


Vue.use(Router)


function create(i) {
  return new Array(i).fill(1).map((_, index) => {
      var i = index + 1;
      return {
        path: '/demo' + i,
        name: '示例' + i,
        component: () => import('@/view/demo/demo' + i)
      }
    }
  )
}

export const routes = [{
  path: '/',
  name: 'HomePage',
  component: HomePage
},
  ...create(100)
]

export default new Router({
  routes
})
